package nimy.info.android.dinnertime.preference;

import nimy.info.android.dinnertime.HomeActivity;
import nimy.info.android.dinnertime.R;
import android.os.Bundle;

import com.actionbarsherlock.app.SherlockPreferenceActivity;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;

public class PreferenceActivity extends SherlockPreferenceActivity {
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Used to put dark icons on light action bar
		// boolean isLight = HomeActivity.THEME == R.style.Theme_Sherlock_Light;

		menu.add("Save")
				.setIcon(android.R.drawable.ic_menu_save)
				.setShowAsAction(
						MenuItem.SHOW_AS_ACTION_IF_ROOM
								| MenuItem.SHOW_AS_ACTION_WITH_TEXT);
		return super.onCreateOptionsMenu(menu);
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		setTheme(HomeActivity.THEME); // Used for theme switching in samples
		super.onCreate(savedInstanceState);
		addPreferencesFromResource(R.xml.preference);
	}
}
